/*
 * hash.cpp
 *
 *  Created on: Aug 6, 2012
 *      Author: jh238d
 */

#include <iostream>
#include <ext/hash_map>
#include <ext/hash_set>
using namespace std;
using namespace __gnu_cxx;


int main() {
	hash_map<const char*, bool> M;
	hash_set<char*> S;
	/* hash_map*/
	M["a"] = true;
	cout << M["a"] << endl;
	typedef pair<const char*, int> p;
	M.insert(p("b", false));
	cout << M["b"] << endl;
	cout << M.size()<< endl;
	if(M.find("a")!=M.end()){
		cout << "erasing a" << endl;
		M.erase("a");
		if(M.find("a")==M.end()){
			cout << "erasing successfully!" << endl;
		}
	}
	/*hash_set*/
	S.insert("abc");
	if(S.find("abc")!=S.end())
		cout << "find abc!" << endl;
	S.erase("abc");
	if(S.find("abc")==S.end())
		cout << "erasing abc successfully!" << endl;

	return 0;
}



